/*
 * Licensed to the Deppon EXPRESS .
 */
package com.depponframework.rocketmq.spring.autoconfigure;

import com.depponframework.rocketmq.spring.annotation.ConsumeMode;
import com.depponframework.rocketmq.spring.annotation.MessageModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.Map;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ConfigurationProperties(prefix = "deppon.rocket")
public class RocketProperties {

    private String nameServerAddress;
    private String accessChannel;
    private Map<String, RocketProperties.Producer> producer;
    private RocketProperties.Consumer consumer;

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class Producer {
        private String nameServerAddress;
        private String producerGroup;
        private String topic;
        private Integer sendMsgTimeout;
        private Integer maxMessageSize;
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class Consumer {
        private String nameServerAddress;
        private String consumerGroup;
        private String topic;
        private String[] tags;
        private Integer pullBatchSize;
        private Integer consumeThreadMin;
        private Integer consumeThreadMax;
        private Integer consumeMessageBatchMaxSize;
        private Long pullInterval;
        private String accessKey;
        private String secretKey;
        private Boolean enableMsgTrace = true;
        private Long consumeTimeout;
        private MessageModel messageModel;
        private ConsumeMode consumeMode;
    }

}
